﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using Hydra.Shell.Interfaces;

namespace Hydra.Shell.EntityPaths
{
    public class PathBuilder
    {
        private IHydraShell shell;
        public Dictionary<int, PathRoot> EntityRoots { get; private set; }
        private ISynchronousProxy synchronousProxy;

        public PathBuilder(IHydraShell shell, ISynchronousProxy synchronousProxy)
        {
            this.shell = shell;
            this.synchronousProxy = synchronousProxy;
            this.EntityRoots = new Dictionary<int, PathRoot>();
        }

        public void RegisterRoot(IHydraPackage package)
        {
            var pathRoot = new PathRoot(package, synchronousProxy);

            this.EntityRoots.Add(package.GetHashCode(), pathRoot);
        }

        public void RegisterRoot(IUnknown service, Guid serviceGuid)
        {
            var pathRoot = new PathRoot(service, serviceGuid, synchronousProxy);

            this.EntityRoots.Add(service.GetHashCode(), pathRoot);
        }
    }
}
